package cn.youwan.market;

import java.util.ArrayList;
import java.util.List;

import cn.youwan.market.adapter.GridViewAdapter;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.GridView;
import android.widget.RelativeLayout;
import android.widget.Toast;
/*
 * 推荐
 * */
public class RecommendActivity extends Activity {
	
	public static List<String> ins;
	private ArrayList<String> lis;
	private RelativeLayout rela_recommend;
	private GridView gv_recommend;
	private GridViewAdapter adapter;
	private Button btn_ins;
	private Button btn_cancel;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_recommend);
		lis=new ArrayList<String>();
		lis.add("0 ");
		lis.add("1 ");
		lis.add("2 ");
		lis.add("3 ");
		lis.add("4 ");
		lis.add("5 ");
		lis.add("6 ");
		lis.add("7 ");
		lis.add("8 ");
		lis.add("9 ");
		lis.add("10 ");
		lis.add("11 ");
		lis.add("12 ");
		lis.add("13 ");
		lis.add("14 ");
		lis.add("15 ");
		ins=new ArrayList<String>();
		ins.addAll(lis);
		rela_recommend=(RelativeLayout)findViewById(R.id.rela_recommend);
		gv_recommend=(GridView)findViewById(R.id.gv_recommend);
		adapter=new GridViewAdapter(lis, this);
		gv_recommend.setAdapter(adapter);
		btn_ins=(Button)findViewById(R.id.btn_ins);
		btn_cancel=(Button)findViewById(R.id.btn_cancel);
		btn_ins.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
                   Toast.makeText(RecommendActivity.this, ins.toString()+"", Toast.LENGTH_LONG).show();

			}
		});
		btn_cancel.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				RecommendActivity.this.finish();
			}
		});

		
	}


}
